<template>
	<view>
		<u-navbar title="活动详情" :border-bottom='false' title-color='#333333' back-icon-color='#333333' back-icon-size='48'></u-navbar>
		<view class="main">
			<view class="actBox">
				<view class="banner" :style="{background:'url('+detailObj.icon+') no-repeat'}">
					<view class="text">
						{{detailObj.title}}
					</view>
					<view class="btn" v-if="detailObj.base_num != detailObj.people_num">
						去报名
					</view>
				</view>
				<view class="num">
					<view class="left">
						计划{{detailObj.base_num}}人
					</view>
					<view class="right">
						已邀请<text>{{detailObj.people_num}}</text>人<u-icon name="arrow-right" color="rgba(0, 0, 0, 0.4)" size="28"></u-icon>
					</view>
				</view>
			</view>
			<view class="lv-text">
				排行榜
			</view>
			<view class="lvBox">
				<u-cell-group>
					<u-cell-item :arrow='false'>
						<view slot='title' class="name">
							<image src="../../../static/imgs/del/wodeyybgi.png" mode=""></image><text>哈哈</text>
						</view>
						<view class="right">
							邀请<text style="color: #FB4F4B;">0</text>人
						</view>
					</u-cell-item>
				</u-cell-group>
			</view>
		</view>
	</view>
</template>

<script>
	import myRequest from '@/api/index.js'
	export default {
		data() {
			return {
				num: 10,
				actId:'', // 活动id
				detailObj:{}
			}
		},
		onLoad(option) {
			console.log(option.id)
			this.actId =option.id
			this.myInvitation()
		},
		methods:{
			async myInvitation(){
				let {actId} =this
				let res =await myRequest.getMyinvit({
					page:'1',
					num:'1000'
				})
				if(res.status) {
					res.data.forEach(item=>{
						if(item.groupon_id == actId) {
							this.detailObj = item
						}
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.main {
		padding: 0 20rpx;

		.actBox {
			margin: 28rpx auto 20rpx;
			width: 710rpx;
			height: auto;
			border-radius: 16rpx;
			overflow: hidden;
			box-shadow: 0px 16rpx 20rpx rgba(0, 0, 0, 0.05);

			.banner {
				width: 710rpx;
				height: 280rpx;
				background-repeat: no-repeat;
				background-size: 100% 100%;
				padding: 44rpx 44rpx 0 28rpx;

				.text {
					font-size: 40rpx;
					font-family: PingFang SC;
					font-weight: 600;
					color: #FFFFFF;
				}

				.btn {
					margin-top: 28rpx;
					width: 176rpx;
					height: 68rpx;
					background: rgba(0, 0, 0, 0.32);
					border-radius: 40rpx;
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: 600;
					color: rgba(255, 255, 255, 0.8);
					line-height: 68rpx;
					text-align: center;
				}
			}

			.num {
				width: 100%;
				height: 120rpx;
				background-color: #FFFFFF;
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0 16rpx;

				.left {
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #333333;
				}

				.right {
					font-size: 32rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #333333;

					text {
						color: #FB4F4B;
					}
				}
			}
		}

		.lv-text {
			width: 100%;
			height: 100rpx;
			line-height: 100rpx;
			font-size: 34rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #333333;
			padding-left: 8rpx;
		}

		.lvBox {
			width: 710rpx;
			height: auto;
			background: #FFFFFF;
			border-radius: 16rpx;
			overflow: hidden;
			.name{
				display: flex;
				align-items: center;
				image{
					width: 64rpx;
					height: 64rpx;
					border-radius: 50%;
				}
				text {
					font-size: 28rpx;
					font-family: Segoe UI;
					font-weight: 400;
					color: #333333;
					margin-left: 10rpx;
				}
			}
		}
	}
</style>
